import request from '@/utils/request'
import { ApiModulesRoutes } from '@/consts.js'

/**
 * 资产类型添加单条数据
 * @param {String} data.typeName
 */

export function apiAddAssetType(data) {
  return request({
    url: `${ApiModulesRoutes.BASE}/assets/addAssetsType`,
    method: 'POST',
    data,
  })
}


/**
 * 资产类型分页查询
 * @param {Number} data.pageNo
 * @param {Number} data.pageSize
 * @param {String} data.keyword
 */

export function apiGetAssetTypeList(data) {
  return request({
    url: `${ApiModulesRoutes.BASE}/assets/findAssetsTypePageByParam`,
    method: 'POST',
    data,
  })
}


/**
 * 资产类型添加单条数据
 * @param {String} data.typeName
 * @param {String} data.id
 */

export function apiEditAssetType(data) {
  return request({
    url: `${ApiModulesRoutes.BASE}/assets/updateAssetsType`,
    method: 'POST',
    data,
  })
}

/**
 * 资产类型删除单条数据
 * @param {String} params.id
 */

export function apiDeleteAssetType(params) {
  return request({
    url: `${ApiModulesRoutes.BASE}/assets/delAssetsTypeById`,
    method: 'GET',
    params,
  })
}
